//
//  UserModel.m
//  BuyWhat
//
//  Created by ios on 2016/11/1.
//  Copyright © 2016年 吕金状. All rights reserved.
//

#import "UserModel.h"
static NSString * const KEY_LOGOFILENAME = @"LOGOFILENAME";
static NSString * const KEY_NICKNAME = @"KEY_NICKNAME";
static NSString * const KEY_NICK = @"KEY_NICK";
static NSString * const KEY_COURSE = @"KEY_COURSE";
static NSString * const KEY_BIRTH = @"KEY_BIRTH";
static NSString * const KEY_GENDER = @"KEY_GENDER";
static NSString * const KEY_MERQTY = @"KEY_MERQTY";
static NSString * const KEY_ACCOUNT = @"KEY_ACCOUNT";
static NSString * const KEY_PASSWORD = @"KEY_PASSWORD";
static NSString * const KEY_HOMEKEYWORD = @"KEY_HOMEKEYWORD";
static NSString * const KEY_SHOWGUIDEFIGURE = @"KEY_SHOWGUIDEFIGURE";
static NSString * const KEY_POSTTYPE = @"KEY_POSTTYPE";
static NSString * const KEY_MERID = @"KEY_MERID";
static NSString * const KEY_JSSIONID = @"KEY_JSSIONID";



static NSString * const KEY_APP_THIRD_URL = @"KEY_APP_THIRD_URL";

static NSString * const KEY_WELCOME = @"KEY_WELCOME";
static NSString * const KEY_JPUSGH = @"KEY_JPUSGH";
static NSString * const KEY_SEARCH = @"KEY_SEARCH";
static NSString * const KEY_PHONE = @"KEY_PHONE";
static NSString * const KEY_TEXT = @"TEXTSTR";

static NSString * const KEY_MEMDIS = @"KEY_MEMDIS";



static NSString * const KEY_STORE = @"KEY_STORE";
static NSString * const KEY_ORDERNO = @"KEY_ORDERNO";
static NSString * const KEY_CASH = @"KEY_CASH";
static NSString * const KEY_MEMID = @"KEY_MEMID";



@interface UserModel();

@end

@implementation UserModel

+(UserModel*)sharedInstanced{
    static UserModel *_userLogon = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _userLogon = [[UserModel alloc] init];
    });
    return _userLogon;
}

- (id)init{
    self = [super init];
    if (!self) {
        return nil;
    }
    return self;
}



#pragma mark - userID
//山海慧我的界面头像
- (NSString *)logofilename {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_LOGOFILENAME:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_LOGOFILENAME];
}

- (void)setLogofilename:(NSString *)logofilename {
    if (!logofilename) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_LOGOFILENAME];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_LOGOFILENAME];
    //判断是否需要更新
    if ([currentUserID isEqualToString:logofilename]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:logofilename forKey:KEY_LOGOFILENAME];
    [[NSUserDefaults standardUserDefaults] synchronize];
}


#pragma mark - searchKeyWord
//山海慧搜索关键字(新项目)
- (NSString *)searchKeyWord {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_SEARCH:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_SEARCH];
}

- (void)setSearchKeyWord:(NSString *)searchKeyWord {
    if (!searchKeyWord) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_SEARCH];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_SEARCH];
    //判断是否需要更新
    if ([currentUserID isEqualToString:searchKeyWord]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:searchKeyWord forKey:KEY_SEARCH];
    [[NSUserDefaults standardUserDefaults] synchronize];
}


#pragma mark - phone
//保存自己的手机号
- (NSString *)phone {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_PHONE:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_PHONE];
}

- (void)setPhone:(NSString *)phone {
    if (!phone) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_PHONE];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_PHONE];
    //判断是否需要更新
    if ([currentUserID isEqualToString:phone]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:phone forKey:KEY_PHONE];
    [[NSUserDefaults standardUserDefaults] synchronize];
}


#pragma mark -- memid


//山海慧门店(配送时候存储)
- (NSString *)memid {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_MEMID:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_MEMID];
}

- (void)setMemid:(NSString *)memid {
    if (!memid) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_MEMID];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_MEMID];
    //判断是否需要更新
    if ([currentUserID isEqualToString:memid]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:memid forKey:KEY_MEMID];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

#pragma mark -- 昵称


//昵称存储
- (NSString *)nickname {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_NICK:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_NICK];
}

- (void)setNickname:(NSString *)nickname {
    if (!nickname) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_NICK];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_NICK];
    //判断是否需要更新
    if ([currentUserID isEqualToString:nickname]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:nickname forKey:KEY_NICK];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

#pragma mark - 生日
//生日(新项目)
- (NSString *)birthDay {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_BIRTH:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_BIRTH];
}

- (void)setBirthDay:(NSString *)birthDay {
    if (!birthDay) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_BIRTH];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_BIRTH];
    //判断是否需要更新
    if ([currentUserID isEqualToString:birthDay]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:birthDay forKey:KEY_BIRTH];
    [[NSUserDefaults standardUserDefaults] synchronize];
}


#pragma mark - 性别
//性别(新项目)
- (NSString *)gender {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_GENDER:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_GENDER];
}

- (void)setGender:(NSString *)gender {
    if (!gender) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_GENDER];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_GENDER];
    //判断是否需要更新
    if ([currentUserID isEqualToString:gender]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:gender forKey:KEY_GENDER];
    [[NSUserDefaults standardUserDefaults] synchronize];
}



#pragma mark -- 疗程套装关键字

//昵称存储
- (NSString *)courseKeyWord {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_COURSE:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_COURSE];
}

- (void)setCourseKeyWord:(NSString *)courseKeyWord {
    if (!courseKeyWord) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_COURSE];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_COURSE];
    //判断是否需要更新
    if ([currentUserID isEqualToString:courseKeyWord]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:courseKeyWord forKey:KEY_COURSE];
    [[NSUserDefaults standardUserDefaults] synchronize];
}


#pragma mark - 是否显示引导图

- (NSString *)showGuideFigure{
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_SHOWGUIDEFIGURE:@"1"}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_SHOWGUIDEFIGURE];
}


- (void)setShowGuideFigure:(NSString *)showGuideFigure{
    if (!showGuideFigure) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_SHOWGUIDEFIGURE];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_SHOWGUIDEFIGURE];
    //判断是否需要更新
    if ([currentUserID isEqualToString:showGuideFigure]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:showGuideFigure forKey:KEY_SHOWGUIDEFIGURE];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

#pragma mark - 购物车数量
//山海慧用户名
- (NSString *)merqty {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_MERQTY:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_MERQTY];
}

- (void)setMerqty:(NSString *)merqty {
    if (!merqty) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_MERQTY];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_MERQTY];
    //判断是否需要更新
    currentUserID = [NSString stringWithFormat:@"%@",currentUserID];
    if ([currentUserID  isEqualToString:merqty]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:merqty forKey:KEY_MERQTY];
    [[NSUserDefaults standardUserDefaults] synchronize];
}


//新项目账号

#pragma mark - account
//山海慧收货人
- (NSString *)account {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_ACCOUNT:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_ACCOUNT];
}

- (void)setAccount:(NSString *)account {
    if (!account) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_ACCOUNT];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_ACCOUNT];
    //判断是否需要更新
    if ([currentUserID isEqualToString:account]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:account forKey:KEY_ACCOUNT];
    [[NSUserDefaults standardUserDefaults] synchronize];
}




//新项目密码
#pragma mark - password
//山海慧收货方式
- (NSString *)password {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_PASSWORD:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_PASSWORD];
}

- (void)setPassword:(NSString *)password {
    if (!password) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_PASSWORD];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_PASSWORD];
    //判断是否需要更新
    if ([currentUserID isEqualToString:password]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:password forKey:KEY_PASSWORD];
    [[NSUserDefaults standardUserDefaults] synchronize];
}




//保存首页的关键字
#pragma mark - homeKeyword
//山海慧收货方式
- (NSString *)homeKeyword {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_HOMEKEYWORD:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_HOMEKEYWORD];
}

- (void)setHomeKeyword:(NSString *)homeKeyword {
    if (!homeKeyword) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_HOMEKEYWORD];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_HOMEKEYWORD];
    //判断是否需要更新
    if ([currentUserID isEqualToString:homeKeyword]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:homeKeyword forKey:KEY_HOMEKEYWORD];
    [[NSUserDefaults standardUserDefaults] synchronize];
}



#pragma mark - postType
//山海慧配送地址
- (NSString *)postType {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_POSTTYPE:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_POSTTYPE];
}

- (void)setPostType:(NSString *)postType {
    if (!postType) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_POSTTYPE];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_POSTTYPE];
    //判断是否需要更新
    if ([currentUserID isEqualToString:postType]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:postType forKey:KEY_POSTTYPE];
    [[NSUserDefaults standardUserDefaults] synchronize];
}


//保存商品id
#pragma mark - merid
//山海慧收货方式
- (NSString *)merid {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_MERID:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_MERID];
}

- (void)setMerid:(NSString *)merid {
    if (!merid) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_MERID];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_MERID];
    //判断是否需要更新
    if ([currentUserID isEqualToString:merid]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:merid forKey:KEY_MERID];
    [[NSUserDefaults standardUserDefaults] synchronize];
}






//保存商品jessionId
#pragma mark - jessionId
//山海慧收货方式
- (NSString *)jessionId {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_JSSIONID:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_JSSIONID];
}

- (void)setJessionId:(NSString *)jessionId {
    if (!jessionId) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_JSSIONID];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_JSSIONID];
    //判断是否需要更新
    if ([currentUserID isEqualToString:jessionId]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:jessionId forKey:KEY_JSSIONID];
    [[NSUserDefaults standardUserDefaults] synchronize];
}



























#pragma mark - memDisTestStr
//山海慧会员配送备注
- (NSString *)memDisTestStr {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_MEMDIS:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_MEMDIS];
}

- (void)setMemDisTestStr:(NSString *)memDisTestStr {
    if (!memDisTestStr) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_MEMDIS];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_MEMDIS];
    //判断是否需要更新
    if ([currentUserID isEqualToString:memDisTestStr]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:memDisTestStr forKey:KEY_MEMDIS];
    [[NSUserDefaults standardUserDefaults] synchronize];
}



#pragma mark - storeTestStr
//山海慧门店自提备注
- (NSString *)storeTestStr {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_STORE:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_STORE];
}

- (void)setStoreTestStr:(NSString *)storeTestStr {
    if (!storeTestStr) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_STORE];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_STORE];
    //判断是否需要更新
    if ([currentUserID isEqualToString:storeTestStr]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:storeTestStr forKey:KEY_STORE];
    [[NSUserDefaults standardUserDefaults] synchronize];
}


#pragma mark - orderNo
//山海慧门店自提备注
- (NSString *)orderNo {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_ORDERNO:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_ORDERNO];
}

- (void)setOrderNo:(NSString *)orderNo {
    if (!orderNo) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_ORDERNO];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_ORDERNO];
    //判断是否需要更新
    if ([currentUserID isEqualToString:orderNo]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:orderNo forKey:KEY_ORDERNO];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

#pragma mark - inputCashText
//山海慧门店自提备注
- (NSString *)inputCashText {
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_CASH:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_CASH];
}

- (void)setInputCashText:(NSString *)inputCashText {
    if (!inputCashText) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_CASH];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentUserID = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_CASH];
    //判断是否需要更新
    if ([currentUserID isEqualToString:inputCashText]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:inputCashText forKey:KEY_CASH];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

















#pragma mark - nickName

- (NSString *)nickName{
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_NICKNAME:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_NICKNAME];
}

/**
 设置用户名
 
 @param nickName 用户名
 */
- (void)setNickName:(NSString *)nickName{
    if (!nickName) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_NICKNAME];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentNickName = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_NICKNAME];
    //判断是否需要更新
    if ([currentNickName isEqualToString:nickName]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:nickName forKey:KEY_NICKNAME];
    [[NSUserDefaults standardUserDefaults] synchronize];
    
}


#pragma mark - app_third_url

- (NSString *)app_third_url{
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_APP_THIRD_URL:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_APP_THIRD_URL];
}

/**
 web页地址
 
 @param app_third_url app_third_url description
 */
- (void)setApp_third_url:(NSString *)app_third_url{
    if (!app_third_url) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_APP_THIRD_URL];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentImgUrl = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_APP_THIRD_URL];
    //判断是否需要更新
    if ([currentImgUrl isEqualToString:app_third_url]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:app_third_url forKey:KEY_APP_THIRD_URL];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

#pragma mark - welcome

- (NSString *)welcome{
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_WELCOME:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_WELCOME];
}

/**
 欢迎语
 
 @param welcome money description
 */
- (void)setWelcome:(NSString *)welcome{
    if (!welcome) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_WELCOME];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentImgUrl = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_WELCOME];
    //判断是否需要更新
    if ([currentImgUrl isEqualToString:welcome]) {
        return;
    }
    [[NSUserDefaults standardUserDefaults] setObject:welcome forKey:KEY_WELCOME];
    [[NSUserDefaults standardUserDefaults] synchronize];
    
    
}

#pragma mark - jpush_key

- (NSString *)jpush_key{
    [[NSUserDefaults standardUserDefaults] registerDefaults:@{KEY_JPUSGH:@""}];
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_JPUSGH];
}

- (void)setJpush_key:(NSString *)jpush_key{
    if (!jpush_key) {
        [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:KEY_JPUSGH];
        [[NSUserDefaults standardUserDefaults] synchronize];
        return;
    }
    //获取本地数据
    NSString *currentImgUrl = [[NSUserDefaults standardUserDefaults] objectForKey:KEY_JPUSGH];
    //判断是否需要更新
    if ([currentImgUrl isEqualToString:jpush_key]) {
        return;
    }
    
    [[NSUserDefaults standardUserDefaults] setObject:jpush_key forKey:KEY_JPUSGH];
    [[NSUserDefaults standardUserDefaults] synchronize];
}



@end
